#include "Tooltip.h"
#include "Commctrl.h"

Tooltip::Tooltip()
: m_hWnd(NULL)
{
}
Tooltip::~Tooltip()
{

}

void Tooltip::CreateTooltip(HWND a_hTool, char* a_pLabel)
{
	m_hWnd = CreateWindowEx(NULL, TOOLTIPS_CLASS, "", WS_POPUP | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL);

	TOOLINFO ti;
	ZeroMemory(&ti, sizeof(TOOLINFO));
	ti.cbSize = sizeof(ti);
	ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
	ti.uId = (UINT_PTR)a_hTool; //pointer to the item, such as toolbar thing etc
	ti.lpszText = a_pLabel;

	SendMessage(m_hWnd, TTM_ADDTOOL, 0, (LPARAM)&ti);
}